home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Daemon
/
TaskName.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-09-12
|
576b
|
33 lines
#include "mp.h"
extern struct MPSem *MPSem;
STRPTR SetupTaskName(STRPTR Buffer,STRPTR FuncName,LONG BufferSize)
{
STRPTR oldname;
LONG l;
oldname=FindTask(0)->tc_Node.ln_Name;
if(MPSem->Debug)
{ // install new name
l=strlen(oldname);
strncpy(Buffer,oldname,BufferSize);
Buffer[BufferSize-1]=0;
if(l<BufferSize)
{
strncat(Buffer,FuncName,BufferSize-l);
Buffer[BufferSize-1]=0;
}
FindTask(0)->tc_Node.ln_Name=Buffer;
}
return(oldname);
}
void SetTaskName(STRPTR Name)
{
FindTask(0)->tc_Node.ln_Name=Name;
}